--
-- PostgreSQL database dump
--

-- Dumped from database version 9.0.3
-- Dumped by pg_dump version 9.0.3
-- Started on 2011-06-05 15:52:52

SET statement_timeout = 0;
SET client_encoding = 'UTF8';
SET standard_conforming_strings = off;
SET check_function_bodies = false;
SET client_min_messages = warning;
SET escape_string_warning = off;

--
-- TOC entry 1814 (class 1262 OID 24663)
-- Name: BD8-4; Type: DATABASE; Schema: -; Owner: postgres
--

CREATE DATABASE "BD8-4" WITH TEMPLATE = template0 ENCODING = 'UTF8' LC_COLLATE = 'Spanish_Spain.1252' LC_CTYPE = 'Spanish_Spain.1252';


ALTER DATABASE "BD8-4" OWNER TO postgres;

\connect "BD8-4"

SET statement_timeout = 0;
SET client_encoding = 'UTF8';
SET standard_conforming_strings = off;
SET check_function_bodies = false;
SET client_min_messages = warning;
SET escape_string_warning = off;

--
-- TOC entry 319 (class 2612 OID 11574)
-- Name: plpgsql; Type: PROCEDURAL LANGUAGE; Schema: -; Owner: postgres
--

CREATE OR REPLACE PROCEDURAL LANGUAGE plpgsql;


ALTER PROCEDURAL LANGUAGE plpgsql OWNER TO postgres;

SET search_path = public, pg_catalog;

SET default_tablespace = '';

SET default_with_oids = false;

--
-- TOC entry 1511 (class 1259 OID 24664)
-- Dependencies: 5
-- Name: estudiante; Type: TABLE; Schema: public; Owner: postgres; Tablespace: 
--

CREATE TABLE estudiante (
    cedula character varying NOT NULL,
    nombre character varying,
    apellido character varying,
    carrera character varying,
    semestre integer
);


ALTER TABLE public.estudiante OWNER TO postgres;

--
-- TOC entry 1512 (class 1259 OID 24670)
-- Dependencies: 5
-- Name: planteamiento; Type: TABLE; Schema: public; Owner: postgres; Tablespace: 
--

CREATE TABLE planteamiento (
    cedula character varying NOT NULL,
    descripcion character varying,
    fecha date,
    codtipoplan integer NOT NULL,
    id integer NOT NULL,
    resuelto boolean
);


ALTER TABLE public.planteamiento OWNER TO postgres;

--
-- TOC entry 1513 (class 1259 OID 24676)
-- Dependencies: 5 1512
-- Name: plantamiento_id_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--

CREATE SEQUENCE plantamiento_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.plantamiento_id_seq OWNER TO postgres;

--
-- TOC entry 1817 (class 0 OID 0)
-- Dependencies: 1513
-- Name: plantamiento_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--

ALTER SEQUENCE plantamiento_id_seq OWNED BY planteamiento.id;


--
-- TOC entry 1818 (class 0 OID 0)
-- Dependencies: 1513
-- Name: plantamiento_id_seq; Type: SEQUENCE SET; Schema: public; Owner: postgres
--

SELECT pg_catalog.setval('plantamiento_id_seq', 1, false);


--
-- TOC entry 1514 (class 1259 OID 24678)
-- Dependencies: 5
-- Name: tipoPlant_codTipoPlan_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--

CREATE SEQUENCE "tipoPlant_codTipoPlan_seq"
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public."tipoPlant_codTipoPlan_seq" OWNER TO postgres;

--
-- TOC entry 1819 (class 0 OID 0)
-- Dependencies: 1514
-- Name: tipoPlant_codTipoPlan_seq; Type: SEQUENCE SET; Schema: public; Owner: postgres
--

SELECT pg_catalog.setval('"tipoPlant_codTipoPlan_seq"', 4, true);


--
-- TOC entry 1515 (class 1259 OID 24680)
-- Dependencies: 1795 5
-- Name: tipoplant; Type: TABLE; Schema: public; Owner: postgres; Tablespace: 
--

CREATE TABLE tipoplant (
    codtipoplan integer DEFAULT nextval('"tipoPlant_codTipoPlan_seq"'::regclass) NOT NULL,
    nombplan character varying
);


ALTER TABLE public.tipoplant OWNER TO postgres;

--
-- TOC entry 1516 (class 1259 OID 24687)
-- Dependencies: 5
-- Name: usuario; Type: TABLE; Schema: public; Owner: postgres; Tablespace: 
--

CREATE TABLE usuario (
    uscedula integer NOT NULL,
    usnombre character varying,
    usapellido character varying,
    usuario character varying,
    password character varying
);


ALTER TABLE public.usuario OWNER TO postgres;

--
-- TOC entry 1794 (class 2604 OID 24693)
-- Dependencies: 1513 1512
-- Name: id; Type: DEFAULT; Schema: public; Owner: postgres
--

ALTER TABLE planteamiento ALTER COLUMN id SET DEFAULT nextval('plantamiento_id_seq'::regclass);


--
-- TOC entry 1808 (class 0 OID 24664)
-- Dependencies: 1511
-- Data for Name: estudiante; Type: TABLE DATA; Schema: public; Owner: postgres
--

INSERT INTO estudiante (cedula, nombre, apellido, carrera, semestre) VALUES ('17727018', 'atr', 'mej', 'in', 2);
INSERT INTO estudiante (cedula, nombre, apellido, carrera, semestre) VALUES ('12345678', 'gre', 'sala', 'ing informatica', 6);
INSERT INTO estudiante (cedula, nombre, apellido, carrera, semestre) VALUES ('87654321', 'chi', 'lili', 'ing produccion', 8);
INSERT INTO estudiante (cedula, nombre, apellido, carrera, semestre) VALUES ('19287364', 'and', 'salaz', 'matematica', 9);
INSERT INTO estudiante (cedula, nombre, apellido, carrera, semestre) VALUES ('14928487', 'jose', 'cast', 'analisis', 5);
INSERT INTO estudiante (cedula, nombre, apellido, carrera, semestre) VALUES ('17726018', 'fvjvnjsk', 'ksjfvnksjv', 'kjnsfk', 2);
INSERT INTO estudiante (cedula, nombre, apellido, carrera, semestre) VALUES ('1', 'd', 'd', 'd', 1);


--
-- TOC entry 1809 (class 0 OID 24670)
-- Dependencies: 1512
-- Data for Name: planteamiento; Type: TABLE DATA; Schema: public; Owner: postgres
--

INSERT INTO planteamiento (cedula, descripcion, fecha, codtipoplan, id, resuelto) VALUES ('17726018', 'a', '2011-11-09', 1, 1, true);
INSERT INTO planteamiento (cedula, descripcion, fecha, codtipoplan, id, resuelto) VALUES ('1', 'revlevjerverveverve', '2011-04-28', 3, 2, true);
INSERT INTO planteamiento (cedula, descripcion, fecha, codtipoplan, id, resuelto) VALUES ('17726018', 'zfsdg', '2011-05-29', 2, 3, false);
INSERT INTO planteamiento (cedula, descripcion, fecha, codtipoplan, id, resuelto) VALUES ('17726018', '2211536', '2011-06-01', 1, 4, false);


--
-- TOC entry 1810 (class 0 OID 24680)
-- Dependencies: 1515
-- Data for Name: tipoplant; Type: TABLE DATA; Schema: public; Owner: postgres
--

INSERT INTO tipoplant (codtipoplan, nombplan) VALUES (1, 'solicitud');
INSERT INTO tipoplant (codtipoplan, nombplan) VALUES (2, 'sugerencia');
INSERT INTO tipoplant (codtipoplan, nombplan) VALUES (3, 'idea');
INSERT INTO tipoplant (codtipoplan, nombplan) VALUES (4, 'g');


--
-- TOC entry 1811 (class 0 OID 24687)
-- Dependencies: 1516
-- Data for Name: usuario; Type: TABLE DATA; Schema: public; Owner: postgres
--

INSERT INTO usuario (uscedula, usnombre, usapellido, usuario, password) VALUES (1, 's', 's', '2', '2');
INSERT INTO usuario (uscedula, usnombre, usapellido, usuario, password) VALUES (2, 'd', 'd', 'd', '4');


--
-- TOC entry 1797 (class 2606 OID 24695)
-- Dependencies: 1511 1511
-- Name: cedula; Type: CONSTRAINT; Schema: public; Owner: postgres; Tablespace: 
--

ALTER TABLE ONLY estudiante
    ADD CONSTRAINT cedula PRIMARY KEY (cedula);


--
-- TOC entry 1803 (class 2606 OID 24697)
-- Dependencies: 1515 1515
-- Name: codTipoPlan; Type: CONSTRAINT; Schema: public; Owner: postgres; Tablespace: 
--

ALTER TABLE ONLY tipoplant
    ADD CONSTRAINT "codTipoPlan" PRIMARY KEY (codtipoplan);


--
-- TOC entry 1801 (class 2606 OID 24699)
-- Dependencies: 1512 1512
-- Name: id; Type: CONSTRAINT; Schema: public; Owner: postgres; Tablespace: 
--

ALTER TABLE ONLY planteamiento
    ADD CONSTRAINT id PRIMARY KEY (id);


--
-- TOC entry 1805 (class 2606 OID 24701)
-- Dependencies: 1516 1516
-- Name: pkUSCedula; Type: CONSTRAINT; Schema: public; Owner: postgres; Tablespace: 
--

ALTER TABLE ONLY usuario
    ADD CONSTRAINT "pkUSCedula" PRIMARY KEY (uscedula);


--
-- TOC entry 1798 (class 1259 OID 24702)
-- Dependencies: 1512
-- Name: fki_cedula; Type: INDEX; Schema: public; Owner: postgres; Tablespace: 
--

CREATE INDEX fki_cedula ON planteamiento USING btree (cedula);


--
-- TOC entry 1799 (class 1259 OID 24703)
-- Dependencies: 1512
-- Name: fki_codTipoPlan; Type: INDEX; Schema: public; Owner: postgres; Tablespace: 
--

CREATE INDEX "fki_codTipoPlan" ON planteamiento USING btree (codtipoplan);


--
-- TOC entry 1806 (class 2606 OID 24704)
-- Dependencies: 1511 1512 1796
-- Name: cedula; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY planteamiento
    ADD CONSTRAINT cedula FOREIGN KEY (cedula) REFERENCES estudiante(cedula);


--
-- TOC entry 1807 (class 2606 OID 24709)
-- Dependencies: 1802 1515 1512
-- Name: codTipoPLan; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY planteamiento
    ADD CONSTRAINT "codTipoPLan" FOREIGN KEY (codtipoplan) REFERENCES tipoplant(codtipoplan);


--
-- TOC entry 1816 (class 0 OID 0)
-- Dependencies: 5
-- Name: public; Type: ACL; Schema: -; Owner: postgres
--

REVOKE ALL ON SCHEMA public FROM PUBLIC;
REVOKE ALL ON SCHEMA public FROM postgres;
GRANT ALL ON SCHEMA public TO postgres;
GRANT ALL ON SCHEMA public TO PUBLIC;


-- Completed on 2011-06-05 15:52:52

--
-- PostgreSQL database dump complete
--

